﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core.DS
{
    public static partial class experiment
    {
        public static dynamic getExperimentInfo(int eid)
        {
            var sql = new Sql.SqlDataContext();
            var e = sql.DSExperiment.FirstOrDefault(row => row.eid == eid);
            if (e == null) return new
            {
                success = false,
                msg = "实验不存在"
            };
            return new
            {
                success = true,
                e.title,
                e.description,
                startTime = e.startTime.toTimeString(),
                endTime = e.endTime.toTimeString()
            };
        }
    }
}
